package org.shanyu.tide.controller;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.shanyu.tide.event.OrderEvent;
import org.shanyu.tide.service.HrService;
import org.shanyu.tide.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class FlowController {

    //private final static Logger logger = LoggerFactory.getLogger(FlowController.class);

    @Autowired
    HrService hrService;

    @Autowired
    ApplicationContext applicationContext;

    @GetMapping("/flow/myFlow")
    public String myFlow() {

        applicationContext.publishEvent(new OrderEvent(applicationContext,"36"));

        log.info("成功通过token认证！" );

        return JSON.toJSONString(JsonResult.success("成功通过token认证！"));
    }

}
